home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 January / january_2001.iso / intercd / root / ^4Developers / VB / visbasdb / VBDB / VBDB Code / VB5 Code / Class 6 / QuickExample9.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-14  |  2.0 KB  |  70 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   1395
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   4680
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   1395
  11.    ScaleWidth      =   4680
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton Command2 
  14.       Caption         =   "Command2"
  15.       Height          =   495
  16.       Left            =   2400
  17.       TabIndex        =   2
  18.       Top             =   840
  19.       Width           =   1215
  20.    End
  21.    Begin VB.CommandButton Command1 
  22.       Caption         =   "Command1"
  23.       Height          =   495
  24.       Left            =   960
  25.       TabIndex        =   0
  26.       Top             =   840
  27.       Width           =   1215
  28.    End
  29.    Begin MSComDlg.CommonDialog CommonDialog1 
  30.       Left            =   4080
  31.       Top             =   840
  32.       _ExtentX        =   847
  33.       _ExtentY        =   847
  34.       _Version        =   393216
  35.       CancelError     =   -1  'True
  36.    End
  37.    Begin VB.Label Label1 
  38.       Caption         =   "Label1"
  39.       Height          =   495
  40.       Left            =   120
  41.       TabIndex        =   1
  42.       Top             =   120
  43.       Width           =   4455
  44.    End
  45. Attribute VB_Name = "Form1"
  46. Attribute VB_GlobalNameSpace = False
  47. Attribute VB_Creatable = False
  48. Attribute VB_PredeclaredId = True
  49. Attribute VB_Exposed = False
  50. Private Sub Command1_Click()
  51. CommonDialog1.Flags = cdlOFNFileMustExist + cdlOFNPathMustExist
  52. On Error GoTo CancelPressed
  53. CommonDialog1.ShowOpen
  54. Label1.Caption = CommonDialog1.filename
  55. Exit Sub
  56. CancelPressed:
  57. Label1.Caption = "Cancel Pressed"
  58. Exit Sub
  59. End Sub
  60. Private Sub Command2_Click()
  61. CommonDialog1.Flags = cdlOFNOverwritePrompt + cdlOFNPathMustExist
  62. On Error GoTo CancelPressed
  63. CommonDialog1.ShowSave
  64. Label1.Caption = CommonDialog1.filename
  65. Exit Sub
  66. CancelPressed:
  67. Label1.Caption = "Cancel Pressed"
  68. Exit Sub
  69. End Sub
  70.